INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

IF(WIN32)
	INCLUDE_DIRECTORIES(${3RDPARTY_DIR}/include/netcdf)
ELSE(WIN32)
	INCLUDE_DIRECTORIES(/usr/local/netcdfcxx/include)
	INCLUDE_DIRECTORIES(/usr/local/netcdf4/include)
	LINK_DIRECTORIES(/usr/local/netcdfcxx/lib)	
	LINK_DIRECTORIES(/usr/local/netcdf4/lib)
ENDIF(WIN32)

SET(LIB_NAME OCNetCDF)

SET(TARGET_H
	NetCDFDef.h
	NetCDFReader.h
	NcWrapper.h
	NcVarWrapper.h
	NcDimWrapper.h
	NcDimTime.h
	NcUtil.h
	NcOutput.h
	NcCompute.h
	NcSyncFile.h
	NetcdfWrapper.h
	NetcdfExtract.h
	NetcdfDataReader.h
	NetcdfDimensionWrapper.h
	NetcdfDimensionData.h
	NetcdfNcReader.h
	NetcdfGribReader.h
)

SET(TARGET_SRC
	src/NetCDFReader.cpp
	src/NcWrapper.cpp
	src/NcVarWrapper.cpp
	src/NcDimWrapper.cpp
	src/NcDimTime.cpp
	src/NcUtil.cpp
	src/NcOutput.cpp
	src/NcCompute.cpp
	src/NcSyncFile.cpp
	src/NetcdfWrapper.cpp
	src/NetcdfExtract.cpp
	src/NetcdfDataReader.cpp
	src/NetcdfDimensionWrapper.cpp
	src/NetcdfDimensionData.cpp
	src/NetcdfNcReader.cpp
	src/NetcdfGribReader.cpp
)

SETUP_GROUP()

IF(WIN32)
	SET(TARGET_LIBRARIES
		OCMain
		OCVolume
		OCesium
		OCGrib
		netcdf-cxx4
		jsoncpp
	)

	SET(TARGET_EXTERNAL_LIBRARIES 
		netcdf
		zlib
	)
ELSE(WIN32)
	SET(TARGET_LIBRARIES
		OCMain
		OCesium
		OCGrib
		jsoncpp
	)

	SET(TARGET_EXTERNAL_LIBRARIES 
		netcdf_c++4	
		netcdf
	)
ENDIF(WIN32)

SETUP_LIBRARY(${LIB_NAME})
ADD_DEPENDENCIES(${LIB_NAME} OCMain)
ADD_DEPENDENCIES(${LIB_NAME} OCesium)
ADD_DEPENDENCIES(${LIB_NAME} OCVolume)
